#include <iostream>
#include <vector>

using namespace std;
class Solution
{
public:
    /**
     * @brief 1 <= s.length <= 100
     *
     * @param s
     * @return int
     */
    int countGoodSubstrings(string s)
    {
        int ans = 0, n = s.length();
        for (size_t i = 1; i < n - 1; i++)
        {
            //cout << s[i - 1] << s[i] << s[i + 1] << endl;
            if (s[i - 1] != s[i] && s[i] != s[i + 1] && s[i - 1] != s[i + 1])
            {
                //cout << "Find " << s[i - 1] << s[i] << s[i + 1] << endl;
                ans++;
            }
        }
        return ans;
    }
};
int main()
{
    Solution s;
    string str = "aababcabc";
    cout << s.countGoodSubstrings(str) << endl;
    return 0;
}